import os
import pytest
from utils.send_message import send_message
import sys,logging


if __name__ == "__main__":
    if len(sys.argv) == 2:
        env = sys.argv[1]
        if env not in ["prod","sting","test"]:
            logging.error('传入的环境变量参数错误，应该是：["prod","sting","test"]')
    else:
        env = "prod"



    pytest.main(["-vs","--setup-show", "./testcases/test_runner.py", "--alluredir", "./report/json_report", "--clean-alluredir",f"--env={env}"])
    os.system("allure generate ./report/json_report -o ./report/html_report --clean")
    # 发送消息
    # send_message(env)